<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml" xmlns:v-bind="">
<head>
    <meta charset="UTF-8">
    <title>从业人员</title>
    <link href="../../resources/css/common/bootstrap3.min.css" rel="stylesheet" type="text/css" />
    <link href="../../resources/css/common/datetimepicker.css" rel="stylesheet" type="text/css"/>
    <link href="../../resources/css/common/page.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="../../resources/css/common/component.css" />
    <link rel="Bookmark" href="../../resources/img/login/icon.png" >
    <link rel="Shortcut Icon" href="../../resources/img/login/icon.png" />
    <style>
        td {
            vertical-align: middle;
        }
    </style>
</head>
<!--<link rel="import" href="/html/common/common_list.html" >-->
<div class="container body-content">
    <div id="demo">
        <div class="form-inline" style="margin:2% 0">
            <div class="form-group">
                <a class="btn btn-primary btn-sm"  onclick="goToAddPractitioners()" >添加服务</a>
            </div>
            <div class="form-group">
                <label class="control-label">从业人员名称:</label>
                <input v-model="name" name="queryCondition" data-default="">
                <button  type="submit" class="btn btn-info" @click="search()">查询</button>
            </div>
        </div>

        <div class="form-group">
            <table class="table table-bordered table-responsive table-striped">
                <thead>
                <tr>
                    <th v-for="(value, key) in gridColumns" v-cloak>
                            {{ key | capitalize }}
                    </th>
                </tr>
                </thead>
                <tr v-for="entry in gridData"  v-cloak>
                    <td v-for="(value, key) in gridColumns" >
                        <div v-if="key=='sex'">
                            <span  v-if="entry['sex']==1">男<br></span>
                            <span  v-else>女<br></span>
                        </div>
                        <div v-else-if="key=='level'">
                            <select class="input-sm" @change="changeLevel(entry['id'],entry[key])" v-model="entry[key]">
                                <option value="1" >高级</option>
                                <option value="2" >初级</option>
                            </select>
                        </div>
                        <div v-else-if="key=='oper'">
                            <button type="button" class="btn btn-danger"   @click="del('/backend/practitioners/deletePractitioners',entry['id'])" >删除</button>
                        </div>
                        <div v-else>
                            <div v-html="showHtml(entry[key],value)"></div>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
            </div>
        </div>
    </div>
    <hr />
    <footer>
    </footer>
</div>


<script type="text/x-template" id="page">
    <ul class="pagePagination" >
        <li v-show="current != 1" @click="current-- && goto(current)" ><a href="#">上一页</a></li>
        <li v-for="index in pages" @click="goto(index)" :class="{'active':current == index}" :key="index">
            <a href="#" >{{index}}</a>
        </li>
        <li v-show="allpage != current && allpage != 0 " @click="current++ && goto(current++)"><a href="#" >下一页</a></li>
        <li ><input style="width: 50px" v-model="jump" /></li>
        <span class="btn btn-default" @click="jumpTo">&raquo;|</span>
        <li ><a href="javascript:void(0)" style="border: none;">共{{allpage}}页,共{{count}}条</a></li>
    </ul>
</script>
<div id="app">
    <page></page>
</div>

</body>
<script type="text/javascript" src="../../resources/js/common/jquery-2.1.1.min.js"></script>
<script src="../../resources/js/common/jquery.uploadify.min.js" type="text/javascript"></script>
<script src="../../resources/js/common/bootstrap3.min.js" type="text/javascript"></script>
<script src="../../resources/js/common/vue.min.js"></script>
<script src="../../resources/js/common/load_list.js"></script>
<script src="../../resources/js/common/common.js"></script>
<script>
    //默认数据
    var runUrl='/backend/practitioners/practitionserList';
    var data={};
    //列表th信息
    //列表th信息
    data['th']={'id':'id', 'name':'姓名','sex':'性别','avatar':'头像','telphone':'联系电话','education':'学历','level':'级别','certificate':'资格证','createTime':'创建时间','oper':'操作'};
    //列表字段信息以及类型  类型 video vioce img a no 五种
    data['gridColumns'] = {'id':'no', 'name':'no','sex':'no','avatar':'img','telphone':'no','education':'no','level':'no','certificate':'img','createTime':'no','oper':'操作'};
    data['name']='';
</script>

<script>
    function changeLevel(id,value){
        if(confirm('是否修改该状态')){
            var res = executeAjaxByGet('/backend/practitioners/modifyPractioners?key=level&value='+value+'&id='+id,'');
            if(res.status==1){
                demo.showPages(vm.$children[0].current);
            }else{
                alert("修改失败!请联系管理员");
                return;
            }
        }
    }
    function goToAddPractitioners() {
        window.location.href = "/html/practitioners/practitioners.html";
    }
</script>
</html>

